﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;

namespace opentk_first_project
{
    class TestSpriteClass : IGameObject
    {
        Renderer _renderer = new Renderer();
        TextureManager _textureManager;
        Sprite _testSprite = new Sprite();
        Sprite _testSprite2 = new Sprite();
        public TestSpriteClass(TextureManager textureManager)
        {
            _textureManager = textureManager;
            //_testSprite.Texture = _textureManager.Get("undo");
            //_testSprite.SetHeight(256 * 0.1f);
            //_testSprite2.Texture = _textureManager.Get("undo");
            //_testSprite2.SetPosition(-256, -256);
            //_testSprite2.SetColor4(new Color4(1, 0, 0, 1));
        }
        #region IGameObject Members

        public void UpdateInput(Input input)
        {

        }
        public void Update(double elapsedTime)
        {
        }

        public void Render()
        {
            GL.ClearColor(0.0f, 1.0f, 0.0f, 1.0f);
            GL.Clear(ClearBufferMask.ColorBufferBit);
            GL.Begin(BeginMode.Triangles);
            
                GL.Color4(Color4.Red);
                GL.Vertex2(-50, 0);
                GL.Color4(Color4.Red);
                GL.Vertex2(50, 0);
                GL.Color4(Color4.Red);
                GL.Vertex2(0, 50);
            
            GL.End();
        }

        #endregion
    }
}
